<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    // 私有属性与方法
    class Box {
        static #my = 1;
        #userName = "zhangsan";
        #age = 100;
        constructor() {
            // this.age = 10;
            // console.log(this.#age)
            this.#age = 10;
        }
        run(){
            console.log(this.#userName,Box.#my);
        }
    }
    const obj = new Box();
    obj.run();
    // console.log(Box.#my)
    // const obj = new Box();
    // console.log(obj);
    // console.log(obj.age);
    // console.log(obj["#userName"]);
    // obj.run();

</script>
</html>